<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>维修</title>
		<link rel="stylesheet" href="css/mui.min.css">
		<script src="js/mui.min.js"></script>
		<style>
			html, body {
				height: 100%
			}

			.go {
				margin: 2%;
				float: left;
				text-align: center;
			}

			.go >img{
				width: 50%;
			}
			
			p {
				color: gray;
				font-size: 0.8em;
			}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">修理</h1>
		</header>

		<div class="mui-content">
			<div class="mui-row" style="background: #ffffff; padding:2%;border-radius: 5px; margin: 10px;">
				<div class="mui-col-sm-3 mui-col-xs-3">
					<div onclick="mui.openWindow({url:'group2/gear_list.html'})" class="go">
						<img src="image/list1.png">
						<p>故障列表</p>
					</div>
				</div>
				<div class="mui-col-sm-3 mui-col-xs-3">
					<div onclick="mui.openWindow({url:'group2/to_gear.html'})" class="go">
						<img src="image/list2.png">
						<p>我要报修</p>
					</div>
				</div>
				<div class="mui-col-sm-3 mui-col-xs-3">
					<div onclick="mui.openWindow({url:'group2/gear.html'})" class="go">
						<img src="image/list3.png">
						<p>修理任务</p>
					</div>
				</div>
				<div class="mui-col-sm-3 mui-col-xs-3">
					<div onclick="mui.openWindow({url:'group2/gear_data.html'})" class="go">
						<img src="image/list4.png">
						<p>数据分析</p>
					</div>
				</div>
			</div>
		</div>
		<div style="margin: 2%;">
			<ul class="mui-table-view" id="con">
				<!-- --------------------------数据填充----------------------------------------- -->
				<li class="mui-table-view-cell mui-media" name="123">
					<img class="mui-media-object mui-pull-left" src="image/u=675629265,2686821793&fm=26&gp=0.jpg">
					<div class="mui-media-body">
						教室
						<p class="mui-ellipsis">空调坏了</p>
						<p class="mui-ellipsis">已维修</p>
					</div>
				</li>
				<li class="mui-table-view-cell mui-media" name="123">
					<img class="mui-media-object mui-pull-left" src="image/u=675629265,2686821793&fm=26&gp=0.jpg">
					<div class="mui-media-body">
						教室
						<p class="mui-ellipsis">空调坏了</p>
						<p class="mui-ellipsis">已维修</p>
					</div>
				</li>
				<!-- --------------------------数据填充----------------------------------------- -->
			</ul>
		</div>
		<script>
			function init() {
				mui.ajax({
					url: '',
					type: "post",
					async: false,
					data: {},
					dataType: "json",
					contentType: "application/x-www-form-urlencoded; charset=utf-8",
					jsonp: "jsoncallback",
					success: function(data) {
						var Ele = jQuery("#con");
						Ele.empty();
						var Info = data.gear_list;
						for (var i = 0, l = Info.length; i < l; i++) {
							var tempEle = ' <li class="mui-table-view-cell mui-media">' +
								'<img class="mui-media-object mui-pull-left" src="' + Info[i]['pic'] + '">' +
								'<div class="mui-media-body">' + Info[i]['kind'] +
								'<p class="mui-ellipsis">' + Info[i]['description'] + '</p>';
							if (Info[i]['state'] === 1) {
								tempEle += '<p class="mui-ellipsis">已解决</p>';
							} else {
								tempEle += '<p class="mui-ellipsis">尚未解决</p>';
							}
							tempEle += '</div></li>';
							Ele.append(tempEle)
						}
					},
					error: function() {
						mui.toast("网络开小差了");
					}
				});
			}
		</script>
	</body>
</html>
